package com.mjxie.consumer.controller;

import com.mjxie.common.api.DubboService;
import com.mjxie.feign.api.FeignHelloClient;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/test")
public class TestController {
    @DubboReference(group = "test")
    private DubboService dubboService;

    @Autowired
    private FeignHelloClient feignHelloClient;


    @GetMapping("/dubbo")
    public String dubbo() {
        return dubboService.sayHello();
    }

    @GetMapping("feign")
    public String feign() {
        return feignHelloClient.feignHello();
    }
}
